package com.raymond.smgp.msg.request;

import com.raymond.client.constants.GlobalConstants;
import com.raymond.client.msg.AbstractMessage;
import com.raymond.smgp.enums.CommandIdType;
import com.raymond.smgp.msg.tlv.TLV;

import java.util.ArrayList;
import java.util.List;

/**
 * 短信提交请求
 *
 * @author :  raymond
 * @version :  V1.0
 * @date :  2021-08-05 16:05
 */
public class SubmitRequestMessage extends AbstractMessage {

    private short msgType = 6;

    private byte needReport = 1;

    private short priority = 2; 

    private String serviceId = ""; 

    private String feeType = "00";

    private String feeCode = "000000";

    private String fixedFee = "000000";

    private byte msgFmt;

    private String validTime = "";

    private String atTime = "";

    private String srcTermId = "";

    private String chargeTermId = "";

    private short destTermIdCount; 

    private String[] destTermIdArray = GlobalConstants.EMPTY_STRING_ARRAY;

    private String msgContent;

    private String reserve = "";

    private List<TLV> tlvList = new ArrayList<>();

    public SubmitRequestMessage(int sequenceId) {
        super(sequenceId);
    }

    @Override
    public int getCommandId() {
        return CommandIdType.SUBMIT_REQUEST.getCommandId();
    }

    public int getMsgType() {
        return msgType;
    }

    public void setMsgType(short msgType) {
        this.msgType = msgType;
    }


    public byte getNeedReport() {
        return needReport;
    }

    public void setNeedReport(byte needReport) {
        this.needReport = needReport;
    }

    public short getPriority() {
        return priority;
    }

    public void setPriority(short priority) {
        this.priority = priority;
    }

    public String getServiceId() {
        return serviceId;
    }

    public void setServiceId(String serviceId) {
        this.serviceId = serviceId;
    }

    public String getFeeType() {
        return feeType;
    }

    public void setFeeType(String feeType) {
        this.feeType = feeType;
    }

    public String getFeeCode() {
        return feeCode;
    }

    public void setFeeCode(String feeCode) {
        this.feeCode = feeCode;
    }

    public String getFixedFee() {
        return fixedFee;
    }

    public void setFixedFee(String fixedFee) {
        this.fixedFee = fixedFee;
    }

    public byte getMsgFmt() {
        return msgFmt;
    }

    public void setMsgFmt(byte msgFmt) {
        this.msgFmt = msgFmt;
    }

    public String getValidTime() {
        return validTime;
    }

    public void setValidTime(String validTime) {
        this.validTime = validTime;
    }

    public String getAtTime() {
        return atTime;
    }

    public void setAtTime(String atTime) {
        this.atTime = atTime;
    }

    public String getSrcTermId() {
        return srcTermId;
    }

    public void setSrcTermId(String srcTermId) {
        this.srcTermId = srcTermId;
    }

    public String getChargeTermId() {
        return chargeTermId;
    }

    public void setChargeTermId(String chargeTermId) {
        this.chargeTermId = chargeTermId;
    }

    public short getDestTermIdCount() {
        return destTermIdCount;
    }

    public void setDestTermIdCount(short destTermIdCount) {
        this.destTermIdCount = destTermIdCount;
    }

    public String[] getDestTermIdArray() {
        return destTermIdArray;
    }

    public void setDestTermIdArray(String[] destTermIdArray) {
        this.destTermIdArray = destTermIdArray;
        this.destTermIdCount = (short) (destTermIdArray == null ? 0 : destTermIdArray.length);
    }

    public String getMsgContent() {
        return msgContent;
    }

    public void setMsgContent(String msgContent) {
        this.msgContent = msgContent;
    }

    public String getReserve() {
        return reserve;
    }

    public void setReserve(String reserve) {
        this.reserve = reserve;
    }

    public List<TLV> getTlvList() {
        return tlvList;
    }

    public void addTlv(TLV tlv) {
        tlvList.add(tlv);
    }
}
